using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

using Peradigm.Framework.Domain.Security;
using Peradigm.Framework.Persistence;
using Peradigm.Framework.Domain.Parties;

namespace Liberty.Domain.CaseManagement
{
    [Serializable]
    public class CaseAssignment : PersistentModel
    {
        #region Constants
        #endregion

        #region Event Handlers
        #endregion

        #region Methods
        /// <summary>
        /// Creates a stubbed case assignment populated with frequently used primitives.  
        /// Other aggregated objects are not populated by this factory method.
        /// </summary>
        /// <returns></returns>
        public static CaseAssignment TestInstance()
        {
            CaseAssignment stub = new CaseAssignment();
            stub.EndDate = DateTime.Now.AddMonths( 1 );
            stub.Oid = 12L;
            stub.StartDate = DateTime.Now.AddMonths( -1 );

            return stub;
        }
        #endregion

        #region Properties
	    public Case Case
	    {
		    get 
		    { 
			    return i_Case;
		    }
		    set 
		    { 
			    i_Case = value;
		    }
	    }
        public CaseVolunteer CaseVolunteer
        {
            get
            {
                return i_CaseVolunteer;
            }
            set
            {
                i_CaseVolunteer = value;
            }
        }

        public DateTime? StartDate
        {
            get
            {
                if( i_StartDate.HasValue )
                {
                    return i_StartDate.Value;
                }
                else
                {
                    return null;
                }
            }
            set
            {
                if( value.HasValue )
                {
                    i_StartDate = value;
                }
                else
                {
                    i_StartDate = null;
                }
            }
        }

        public DateTime? EndDate
        {
            get
            {
                if( i_EndDate.HasValue )
                {
                    return i_EndDate.Value;
                }
                else
                {
                    return null;
                }
            }
            set
            {
                if( value.HasValue )
                {
                    i_EndDate = value;
                }
                else
                {
                    i_EndDate = null;
                }
            }
        }
        #endregion

        #region Private Methods
        #endregion

        #region Private Properties
        #endregion

        #region Construction and Finalization
        public CaseAssignment()
        {
        }
        #endregion

        #region Data Elements
        private Case i_Case;
        private CaseVolunteer i_CaseVolunteer;
        private DateTime? i_StartDate;
        private DateTime? i_EndDate;
        #endregion

    }
}